#include<bits/stdc++.h>
using namespace std;

vector<int> add(string x, string y)
{
	reverse(x.begin(), x.end());
	reverse(y.begin(), y.end());
	
	int len = max(x.size(), y.size());
	vector<int> a(len), b(len), c;
	
	for(int i = 0;i < x.size();i++)
		a[i] = (int)(x[i]-'0');
	for(int i = 0;i < y.size();i++)
		b[i] = (int)(y[i]-'0');
		
	int t = 0;
	for(int i = 0;i < len;i++)
	{
		c.push_back(a[i]+b[i]+t);
		if(c[i] > 9)
		{
			t = c[i]/10;
			c[i] %= 10;
		}
		else
			t = 0;
	}
	if(t)
		c.push_back(1);
	reverse(c.begin(), c.end());
	return c;
}

vector<int> MINUS(string x, string y)
{
	reverse(x.begin(), x.end());
	reverse(y.begin(), y.end());
	
	int len = max(x.size(), y.size());
	vector<int> a(len), b(len), c;
	
	for(int i = 0;i < x.size();i++)
		a[i] = (int)(x[i]-'0');
	for(int i = 0;i < y.size();i++)
		b[i] = (int)(y[i]-'0');
		
	int t = 0;
	for(int i = 0;i < len;i++)
	{
		c.push_back(a[i]-b[i]+t);
		if(c[i] < 0)
		{
			t = -1;
			c[i] += 10;
		}
		else
			t = 0;
	}
//	if(t)
//		c.push_back(1);
	reverse(c.begin(), c.end());
	return c;
}

int main()
{
	string s;
	cin>>s;
	vector<int> ans1 = add(s, to_string(1));
	vector<int> ans2 = MINUS(s, to_string(1));
	for(auto i:ans1)
		cout<<i;
	cout<<endl;
	for(auto i:ans2)
		cout<<i;
	return 0;
}

